package com.ricchieri.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

import com.ricchieri.common.BusinessSettings;

@SuppressWarnings("serial")
@MappedSuperclass
public abstract class BaseEntity implements Serializable {
	
    @Id
    @Column(name = "id", insertable = true, updatable = false)
    @GeneratedValue(strategy = GenerationType.AUTO)
	private int id;
	
    @Version
    @Column(name = "optlock", nullable = false)
    private Integer optlock = new Integer(1);
     
    @Column(name = "active", nullable = false)
    private Boolean active = BusinessSettings.ENTITY_ACTIVE;
    
    public BaseEntity() {
    }
    
	public BaseEntity(int id, Integer optlock, Boolean active) {
		super();
		this.id = id;
		this.optlock = optlock;
		this.active = active;
	}

	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public Boolean isActive() {
		return active;
	}
	
	public void setActive(Boolean active) {
		this.active = active;
	}
	
	public int getOptlock() {
		return optlock;
	}
	
	public void setOptlock(int optlock) {
		this.optlock = optlock;
	}

//	public String getUserNewRegister() {
//		return userNewRegister;
//	}
//
//	public void setUserNewRegister(String userNewRegister) {
//		this.userNewRegister = userNewRegister;
//	}
//
//	public Date getDateNewRegister() {
//		return dateNewRegister;
//	}
//
//	public void setDateNewRegister(Date dateNewRegister) {
//		this.dateNewRegister = dateNewRegister;
//	}
//
//	public String getUserUpdateRegister() {
//		return userUpdateRegister;
//	}
//
//	public void setUserUpdateRegister(String userUpdateRegister) {
//		this.userUpdateRegister = userUpdateRegister;
//	}
//
//	public Date getDateUpdateRegister() {
//		return dateUpdateRegister;
//	}
//
//	public void setDateUpdateRegister(Date dateUpdateRegister) {
//		this.dateUpdateRegister = dateUpdateRegister;
//	}

	public Boolean getActive() {
		return active;
	}
}